package com.qny.ai.util;

import com.qny.ai.common.PasswordUtil;

/**
 * 密码生成工具
 */
public class PasswordGenerator {
    public static void main(String[] args) {
        String[] passwords = {"123456", "admin123", "test123"};
        
        System.out.println("生成的密码哈希：");
        System.out.println("==================");
        
        for (String password : passwords) {
            String encoded = PasswordUtil.encode(password);
            System.out.println("密码: " + password);
            System.out.println("哈希: " + encoded);
            System.out.println("验证: " + PasswordUtil.matches(password, encoded));
            System.out.println("---");
        }
        
        // 生成SQL插入语句
        System.out.println("\nSQL插入语句：");
        System.out.println("==================");
        System.out.println("INSERT INTO `app_user` (`username`, `password`, `email`, `preferred_language`) VALUES");
        System.out.println("('admin', '" + PasswordUtil.encode("123456") + "', 'admin@example.com', 'zh'),");
        System.out.println("('test', '" + PasswordUtil.encode("123456") + "', 'test@example.com', 'zh'),");
        System.out.println("('user1', '" + PasswordUtil.encode("123456") + "', 'user1@example.com', 'zh');");
    }
}
